<#include "macrosDisplay.ftl">
<#include "macrosLoops.ftl">
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="ext"%>
<%@ taglib uri="/tags/tps" prefix="tps"%>

<%
//Created 16 May 2005
//$Id: topbar.ftl 2681 2006-07-27 14:56:32 +0000 (Thu, 27 Jul 2006) erik $
%>
<h:form style="margin-bottom: -1; margin:0;">
	<!-- Logo -->
	<div id="logoarea">
		<span id="appname"><h:graphicImage value="${app.logoUrl}" /></span>

		<!-- Global Functions -->
		<div id="globalbar">
			<ul id="globallist">
				<li id="help"><h:graphicImage height="16" width="16" value="/img/gray/help.gif" /><a href="#">Help</a></li>
				<li id="logout"><h:graphicImage height="16" width="16" value="/img/gray/disconnect.gif" /><h:commandLink action="<@hb>globalHandler.logout</@hb>"><h:outputText value="Logout" /></h:commandLink></li>
			</ul>
		</div>
		<span id="login">Welcome, <span id="username"><ext:popup
                styleClass="popup"
                closePopupOnExitingElement="true"
                closePopupOnExitingPopup="true"
                displayAtDistanceX="-100"
                displayAtDistanceY="10" >
                <h:outputText value="<@hb>globalHandler.loginDisplay</@hb>"/>
                <f:facet name="popup"><h:panelGroup><h:dataTable
						value="<@hb>globalHandler.security.currentUser.roles</@hb>"
						var="role"
						styleClass="popup-table"
						rowClasses="inner-tr"
						columnClasses="audit-th,audit-td"
						>
						<h:column>
							<f:facet name="header"><h:outputText value="Security Roles"/></f:facet>
							<h:outputText value="<@hb>role.name</@hb>" />
						</h:column>
					</h:dataTable>
                    </h:panelGroup>
				</f:facet>
            </ext:popup></span></span>	
	</div>
      
	<!--  Tabs -->
	<div id="menu">
		<ul id="nav">
	        <li class="<h:outputText value="<@hb>tabHandler.styleMap[tabHandler.selected == 'Home']</@hb>"/>">
	        	<h:commandLink styleClass="<@hb>tabHandler.styleMap[tabHandler.selected == 'Home']</@hb>link" action="<@hb>tabHandler.getSelected</@hb>" actionListener="<@hb>tabHandler.pick</@hb>">
	        		<h:outputText value="Home" />
	        		<f:param name="picked" value="Home" />
	        	</h:commandLink>
			</li>
			
			<%@include file="/include/entityTabs.jsp" %>
						
			<h:panelGroup rendered="<@hb>globalHandler.superAdmin || globalHandler.access['tab.tasks']</@hb>">
				<h:outputText escape="false" value="<li class=<@hb>tabHandler.styleMap[tabHandler.selected == 'Tasks']</@hb>>"/>
		        	<h:commandLink styleClass="<@hb>tabHandler.styleMap[tabHandler.selected == 'Tasks']</@hb>link" action="<@hb>tabHandler.getSelected</@hb>" actionListener="<@hb>tabHandler.pick</@hb>">
		        		<h:outputText value="Tasks" />
		        		<f:param name="picked" value="Tasks" />
		        	</h:commandLink>
				<h:outputText escape="false" value="</li>"/>
			</h:panelGroup>
			
			<h:panelGroup rendered="<@hb>globalHandler.superAdmin || globalHandler.access['tab.reports']</@hb>">
				<h:outputText escape="false" value="<li class=<@hb>tabHandler.styleMap[tabHandler.selected == 'Reports']</@hb>>"/>
		        	<h:commandLink styleClass="<@hb>tabHandler.styleMap[tabHandler.selected == 'Reports']</@hb>link" action="<@hb>tabHandler.getSelected</@hb>" actionListener="<@hb>tabHandler.pick</@hb>">
		        		<h:outputText value="Reports" />
		        		<f:param name="picked" value="Reports" />
		        	</h:commandLink>
				<h:outputText escape="false" value="</li>"/>
			</h:panelGroup>
			
			<h:panelGroup rendered="<@hb>globalHandler.superAdmin || globalHandler.access['tab.preferences']</@hb>">
				<h:outputText escape="false" value="<li class=<@hb>tabHandler.styleMap[tabHandler.selected == 'Preferences']</@hb>>"/>
		        	<h:commandLink styleClass="<@hb>tabHandler.styleMap[tabHandler.selected == 'Preferences']</@hb>link" action="<@hb>tabHandler.getSelected</@hb>" actionListener="<@hb>tabHandler.pick</@hb>">
		        		<h:outputText value="Preferences" />
		        		<f:param name="picked" value="Preferences" />
		        	</h:commandLink>
				<h:outputText escape="false" value="</li>"/>
			</h:panelGroup>
			
			<h:panelGroup rendered="<@hb>globalHandler.superAdmin || globalHandler.access['tab.import']</@hb>">
				<h:outputText escape="false" value="<li class=<@hb>tabHandler.styleMap[tabHandler.selected == 'Imports']</@hb>>"/>
		        	<h:commandLink styleClass="<@hb>tabHandler.styleMap[tabHandler.selected == 'Imports']</@hb>link" action="<@hb>tabHandler.getSelected</@hb>" actionListener="<@hb>tabHandler.pick</@hb>">
		        		<h:outputText value="Imports" />
		        		<f:param name="picked" value="Imports" />
		        	</h:commandLink>
				<h:outputText escape="false" value="</li>"/>
			</h:panelGroup>
			
			<h:panelGroup rendered="<@hb>globalHandler.superAdmin || globalHandler.access['tab.admin']</@hb>">
		        <h:outputText escape="false" value="<li class=<@hb>tabHandler.styleMap[tabHandler.selected == 'Admin']</@hb>>"/>
		        	<h:commandLink styleClass="<@hb>tabHandler.styleMap[tabHandler.selected == 'Admin']</@hb>link" action="<@hb>tabHandler.getSelected</@hb>" actionListener="<@hb>tabHandler.pick</@hb>">
		        		<h:outputText value="Admin" />
		        		<f:param name="picked" value="Admin" />
		        	</h:commandLink>
				<h:outputText escape="false" value="</li>"/>
			</h:panelGroup>
			
			<%@include file="/include/customTabs.jsp" %>
	    </ul>
	</div>
</h:form>